package com.tuanzi.loan.web.lazy.compensation;

import com.tuanzi.loan.business.service.compensation.CompensationOrderService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.compensation.CompensationOrderRequest;
import com.tuanzi.loan.vo.response.compensation.CompensationOrderResponse;
import org.springframework.data.domain.Page;

/**
 * @author administrator
 * @createTime 2019-06-06 15:43
 */
public class CompensationOrderLazyDataModel extends
        BaseLazyDataModel<CompensationOrderRequest,CompensationOrderResponse> {
    private CompensationOrderService compensationOrderService = SpringContextHolder.getBean(CompensationOrderService.class);

    public CompensationOrderLazyDataModel(CompensationOrderRequest compensationOrderRequest) {
        super(compensationOrderRequest);
    }

    @Override
    protected Page<CompensationOrderResponse> doLoad(PageSearcher<CompensationOrderRequest> pageSearcher) {
        return compensationOrderService.list(pageSearcher);
    }
}
